<?php
defined('IN_IXDCW') or exit('Access Denied');
require_once MD_ROOT.'/member.class.php';
$do = new member;
$menus = array (
    array('在线店列表', '?file=store&moduleid='.$moduleid),
    array('审核在线店', '?file=store&moduleid='.$moduleid.'&action=check'),
);
isset($userid) or $userid = 0;
$CATEGORY = PCache::read('category-4.php');

if($_catids || $_areaids) {
	if(isset($userid)) $itemid = $userid;
	if(isset($member['areaid'])) $post['areaid'] = $member['areaid'];
	require DT_ROOT.'/admin/admin_check.inc.php';
}

if(in_array($action, array('', 'check'))) {

	isset($fields) && isset($dfields[$fields]) or $fields = 0;
	isset($order) && isset($dorder[$order]) or $order = 0;
	$groupid = isset($groupid) ? intval($groupid) : 0;
	$gender = isset($gender) ? intval($gender) : 0;
	$uid = isset($uid) ? intval($uid) : '';
	$username = isset($username) ? trim($username) : '';

	$group_select = group_select('groupid', '会员组', $groupid);

	if($_areaids) $condition .= " AND areaid IN (".$_areaids.")";//CITY
	if($groupid) $condition .= " AND groupid=$groupid";
	if($username) $condition .= " AND username='$username'";
	if($areaid) $condition .= ($ARE['child']) ? " AND areaid IN (".$ARE['arrchildid'].")" : " AND areaid=$areaid";
}
switch($action) {
	case 'check':
		$condition = ' is_store=2 ';
		$stores = $do->getStoreList($condition);
	default:
		$condition = ' is_store=1 ';
		$stores = $do->getStoreList($condition);
		include tpl('store', $module);
	break;
}